﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using YLServiceCLient.YLAdminClient;
using YLPublicService.TransferModel;

namespace YLServerInterface.Forms
{
    /// <summary>
    /// Interaction logic for frmAddTemplate.xaml
    /// </summary>
    public partial class frmAddTemplate : Window
    {
        public frmAddTemplate()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            AdminServiceClient client = AdminServiceClient.GetServiceClient();
            TemplateItem t = new TemplateItem();
            t.mEnable = "1";
            t.mTemplateDetial.mName = txtTemplateName.Text;
            t.mTemplateDetial.mPrice = txtTemplatePrice.Text;
            var ret = client.AddTemplate(t);
            MessageBox.Show(ret.ToString());
            if (ret)
            {
                this.Close();
            }
        }
    }
}
